<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="实现行项目id" prop="fulfillmentLineItemId">
        <el-input
          v-model="queryParams.fulfillmentLineItemId"
          placeholder="请输入实现行项目id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="groupon号码" prop="grouponNumber">
        <el-input
          v-model="queryParams.grouponNumber"
          placeholder="请输入groupon号码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="订单日期" prop="orderDate">
        <el-input
          v-model="queryParams.orderDate"
          placeholder="请输入订单日期"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商家sku项目" prop="merchantSkuItem">
        <el-input
          v-model="queryParams.merchantSkuItem"
          placeholder="请输入商家sku项目"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="请求数量" prop="quantityRequested">
        <el-input
          v-model="queryParams.quantityRequested"
          placeholder="请输入请求数量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="请求得装运方法" prop="shipmentMethodRequested">
        <el-input
          v-model="queryParams.shipmentMethodRequested"
          placeholder="请输入请求得装运方法"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装运地址名称" prop="shipmentAddressName">
        <el-input
          v-model="queryParams.shipmentAddressName"
          placeholder="请输入装运地址名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="发货地址街道" prop="shipmentAddressStreet">
        <el-input
          v-model="queryParams.shipmentAddressStreet"
          placeholder="请输入发货地址街道"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="发货地址城市" prop="shipmentAddressCity">
        <el-input
          v-model="queryParams.shipmentAddressCity"
          placeholder="请输入发货地址城市"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装运地址统计" prop="shipmentAddressStat">
        <el-input
          v-model="queryParams.shipmentAddressStat"
          placeholder="请输入装运地址统计"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装运地址邮政编码" prop="shipmentAddressPostalCode">
        <el-input
          v-model="queryParams.shipmentAddressPostalCode"
          placeholder="请输入装运地址邮政编码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装运地址国家/地区" prop="shipmentAddressCountry">
        <el-input
          v-model="queryParams.shipmentAddressCountry"
          placeholder="请输入装运地址国家/地区"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="礼物" prop="gift">
        <el-input
          v-model="queryParams.gift"
          placeholder="请输入礼物"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="礼品信息" prop="giftMessage">
        <el-input
          v-model="queryParams.giftMessage"
          placeholder="请输入礼品信息"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="出货数量" prop="quantityShipped">
        <el-input
          v-model="queryParams.quantityShipped"
          placeholder="请输入出货数量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装运承运人" prop="shipmentCarrier">
        <el-input
          v-model="queryParams.shipmentCarrier"
          placeholder="请输入装运承运人"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装运方式" prop="shipmentMethod">
        <el-input
          v-model="queryParams.shipmentMethod"
          placeholder="请输入装运方式"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装运跟踪编号" prop="shipmentTrackingNumber">
        <el-input
          v-model="queryParams.shipmentTrackingNumber"
          placeholder="请输入装运跟踪编号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装运日期" prop="shipDate">
        <el-input
          v-model="queryParams.shipDate"
          placeholder="请输入装运日期"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="groupon sku" prop="grouponSku">
        <el-input
          v-model="queryParams.grouponSku"
          placeholder="请输入groupon sku"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="自定义域值" prop="customFieldValue">
        <el-input
          v-model="queryParams.customFieldValue"
          placeholder="请输入自定义域值"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="Permalink" prop="permalink">
        <el-input
          v-model="queryParams.permalink"
          placeholder="请输入Permalink"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目名称" prop="itemName">
        <el-input
          v-model="queryParams.itemName"
          placeholder="请输入项目名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="供应商id" prop="vendorId">
        <el-input
          v-model="queryParams.vendorId"
          placeholder="请输入供应商id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="salesforce交易选项id" prop="salesforceDealOptionId">
        <el-input
          v-model="queryParams.salesforceDealOptionId"
          placeholder="请输入salesforce交易选项id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="groupon成本" prop="grouponCost">
        <el-input
          v-model="queryParams.grouponCost"
          placeholder="请输入groupon成本"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="帐单地址名称" prop="billingAddressName">
        <el-input
          v-model="queryParams.billingAddressName"
          placeholder="请输入帐单地址名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="帐单地址街道" prop="billingAddressStreet">
        <el-input
          v-model="queryParams.billingAddressStreet"
          placeholder="请输入帐单地址街道"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开单地址城市" prop="billingAddressCity">
        <el-input
          v-model="queryParams.billingAddressCity"
          placeholder="请输入开单地址城市"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="帐单地址统计" prop="billingAddressStat">
        <el-input
          v-model="queryParams.billingAddressStat"
          placeholder="请输入帐单地址统计"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="帐单地址邮政编码" prop="billingAddressPostalCode">
        <el-input
          v-model="queryParams.billingAddressPostalCode"
          placeholder="请输入帐单地址邮政编码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开单地址国家/地区" prop="billingAddressCountry">
        <el-input
          v-model="queryParams.billingAddressCountry"
          placeholder="请输入开单地址国家/地区"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="采购订单编号" prop="purchaseOrderNumber">
        <el-input
          v-model="queryParams.purchaseOrderNumber"
          placeholder="请输入采购订单编号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品重量" prop="productWeight">
        <el-input
          v-model="queryParams.productWeight"
          placeholder="请输入产品重量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品重量单位" prop="productWeightUnit">
        <el-input
          v-model="queryParams.productWeightUnit"
          placeholder="请输入产品重量单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品长度" prop="productLength">
        <el-input
          v-model="queryParams.productLength"
          placeholder="请输入产品长度"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品宽度" prop="productWidth">
        <el-input
          v-model="queryParams.productWidth"
          placeholder="请输入产品宽度"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品高度" prop="productHeight">
        <el-input
          v-model="queryParams.productHeight"
          placeholder="请输入产品高度"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品尺寸单位" prop="productDimensionUnit">
        <el-input
          v-model="queryParams.productDimensionUnit"
          placeholder="请输入产品尺寸单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户电话" prop="customerPhone">
        <el-input
          v-model="queryParams.customerPhone"
          placeholder="请输入客户电话"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="国际贸易术语解释通则" prop="incoterms">
        <el-input
          v-model="queryParams.incoterms"
          placeholder="请输入国际贸易术语解释通则"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="高温超导码" prop="htsCode">
        <el-input
          v-model="queryParams.htsCode"
          placeholder="请输入高温超导码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="第三方物流名称" prop="threePlName">
        <el-input
          v-model="queryParams.threePlName"
          placeholder="请输入第三方物流名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="第三方物流仓库货位" prop="threePlWarehouseLocation">
        <el-input
          v-model="queryParams.threePlWarehouseLocation"
          placeholder="请输入第三方物流仓库货位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="套件细节" prop="kittingDetails">
        <el-input
          v-model="queryParams.kittingDetails"
          placeholder="请输入套件细节"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="销售价格" prop="sellPrice">
        <el-input
          v-model="queryParams.sellPrice"
          placeholder="请输入销售价格"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="交易机会id" prop="dealOpportunityId">
        <el-input
          v-model="queryParams.dealOpportunityId"
          placeholder="请输入交易机会id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="出货策略" prop="shipmentStrategy">
        <el-input
          v-model="queryParams.shipmentStrategy"
          placeholder="请输入出货策略"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="履行方式" prop="fulfillmentMethod">
        <el-input
          v-model="queryParams.fulfillmentMethod"
          placeholder="请输入履行方式"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="原产国" prop="countryOfOrigin">
        <el-input
          v-model="queryParams.countryOfOrigin"
          placeholder="请输入原产国"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商人permalink" prop="merchantPermalink">
        <el-input
          v-model="queryParams.merchantPermalink"
          placeholder="请输入商人permalink"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="功能开始日期" prop="featureStartDate">
        <el-input
          v-model="queryParams.featureStartDate"
          placeholder="请输入功能开始日期"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="功能结束日期" prop="featureEndDate">
        <el-input
          v-model="queryParams.featureEndDate"
          placeholder="请输入功能结束日期"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="bom sku" prop="bomSku">
        <el-input
          v-model="queryParams.bomSku"
          placeholder="请输入bom sku"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:order:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:order:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:order:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:order:export']"
        >导出</el-button>
      </el-col>
      <!--<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="bom sku" align="center" prop="id" />
      <el-table-column label="实现行项目id" align="center" prop="fulfillmentLineItemId" />
      <el-table-column label="groupon号码" align="center" prop="grouponNumber" />
      <el-table-column label="订单日期" align="center" prop="orderDate" />
      <el-table-column label="商家sku项目" align="center" prop="merchantSkuItem" />
      <el-table-column label="请求数量" align="center" prop="quantityRequested" />
      <el-table-column label="请求得装运方法" align="center" prop="shipmentMethodRequested" />
      <el-table-column label="装运地址名称" align="center" prop="shipmentAddressName" />
      <el-table-column label="发货地址街道" align="center" prop="shipmentAddressStreet" />
      <el-table-column label="发货地址城市" align="center" prop="shipmentAddressCity" />
      <el-table-column label="装运地址统计" align="center" prop="shipmentAddressStat" />
      <el-table-column label="装运地址邮政编码" align="center" prop="shipmentAddressPostalCode" />
      <el-table-column label="装运地址国家/地区" align="center" prop="shipmentAddressCountry" />
      <el-table-column label="礼物" align="center" prop="gift" />
      <el-table-column label="礼品信息" align="center" prop="giftMessage" />
      <el-table-column label="出货数量" align="center" prop="quantityShipped" />
      <el-table-column label="装运承运人" align="center" prop="shipmentCarrier" />
      <el-table-column label="装运方式" align="center" prop="shipmentMethod" />
      <el-table-column label="装运跟踪编号" align="center" prop="shipmentTrackingNumber" />
      <el-table-column label="装运日期" align="center" prop="shipDate" />
      <el-table-column label="groupon sku" align="center" prop="grouponSku" />
      <el-table-column label="自定义域值" align="center" prop="customFieldValue" />
      <el-table-column label="Permalink" align="center" prop="permalink" />
      <el-table-column label="项目名称" align="center" prop="itemName" />
      <el-table-column label="供应商id" align="center" prop="vendorId" />
      <el-table-column label="salesforce交易选项id" align="center" prop="salesforceDealOptionId" />
      <el-table-column label="groupon成本" align="center" prop="grouponCost" />
      <el-table-column label="帐单地址名称" align="center" prop="billingAddressName" />
      <el-table-column label="帐单地址街道" align="center" prop="billingAddressStreet" />
      <el-table-column label="开单地址城市" align="center" prop="billingAddressCity" />
      <el-table-column label="帐单地址统计" align="center" prop="billingAddressStat" />
      <el-table-column label="帐单地址邮政编码" align="center" prop="billingAddressPostalCode" />
      <el-table-column label="开单地址国家/地区" align="center" prop="billingAddressCountry" />
      <el-table-column label="采购订单编号" align="center" prop="purchaseOrderNumber" />
      <el-table-column label="产品重量" align="center" prop="productWeight" />
      <el-table-column label="产品重量单位" align="center" prop="productWeightUnit" />
      <el-table-column label="产品长度" align="center" prop="productLength" />
      <el-table-column label="产品宽度" align="center" prop="productWidth" />
      <el-table-column label="产品高度" align="center" prop="productHeight" />
      <el-table-column label="产品尺寸单位" align="center" prop="productDimensionUnit" />
      <el-table-column label="客户电话" align="center" prop="customerPhone" />
      <el-table-column label="国际贸易术语解释通则" align="center" prop="incoterms" />
      <el-table-column label="高温超导码" align="center" prop="htsCode" />
      <el-table-column label="第三方物流名称" align="center" prop="threePlName" />
      <el-table-column label="第三方物流仓库货位" align="center" prop="threePlWarehouseLocation" />
      <el-table-column label="套件细节" align="center" prop="kittingDetails" />
      <el-table-column label="销售价格" align="center" prop="sellPrice" />
      <el-table-column label="交易机会id" align="center" prop="dealOpportunityId" />
      <el-table-column label="出货策略" align="center" prop="shipmentStrategy" />
      <el-table-column label="履行方式" align="center" prop="fulfillmentMethod" />
      <el-table-column label="原产国" align="center" prop="countryOfOrigin" />
      <el-table-column label="商人permalink" align="center" prop="merchantPermalink" />
      <el-table-column label="功能开始日期" align="center" prop="featureStartDate" />
      <el-table-column label="功能结束日期" align="center" prop="featureEndDate" />
      <el-table-column label="bom sku" align="center" prop="bomSku" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:order:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:order:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改采购单对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="实现行项目id" prop="fulfillmentLineItemId">
          <el-input v-model="form.fulfillmentLineItemId" placeholder="请输入实现行项目id" />
        </el-form-item>
        <el-form-item label="groupon号码" prop="grouponNumber">
          <el-input v-model="form.grouponNumber" placeholder="请输入groupon号码" />
        </el-form-item>
        <el-form-item label="订单日期" prop="orderDate">
          <el-input v-model="form.orderDate" placeholder="请输入订单日期" />
        </el-form-item>
        <el-form-item label="商家sku项目" prop="merchantSkuItem">
          <el-input v-model="form.merchantSkuItem" placeholder="请输入商家sku项目" />
        </el-form-item>
        <el-form-item label="请求数量" prop="quantityRequested">
          <el-input v-model="form.quantityRequested" placeholder="请输入请求数量" />
        </el-form-item>
        <el-form-item label="请求得装运方法" prop="shipmentMethodRequested">
          <el-input v-model="form.shipmentMethodRequested" placeholder="请输入请求得装运方法" />
        </el-form-item>
        <el-form-item label="装运地址名称" prop="shipmentAddressName">
          <el-input v-model="form.shipmentAddressName" placeholder="请输入装运地址名称" />
        </el-form-item>
        <el-form-item label="发货地址街道" prop="shipmentAddressStreet">
          <el-input v-model="form.shipmentAddressStreet" placeholder="请输入发货地址街道" />
        </el-form-item>
        <el-form-item label="发货地址城市" prop="shipmentAddressCity">
          <el-input v-model="form.shipmentAddressCity" placeholder="请输入发货地址城市" />
        </el-form-item>
        <el-form-item label="装运地址统计" prop="shipmentAddressStat">
          <el-input v-model="form.shipmentAddressStat" placeholder="请输入装运地址统计" />
        </el-form-item>
        <el-form-item label="装运地址邮政编码" prop="shipmentAddressPostalCode">
          <el-input v-model="form.shipmentAddressPostalCode" placeholder="请输入装运地址邮政编码" />
        </el-form-item>
        <el-form-item label="装运地址国家/地区" prop="shipmentAddressCountry">
          <el-input v-model="form.shipmentAddressCountry" placeholder="请输入装运地址国家/地区" />
        </el-form-item>
        <el-form-item label="礼物" prop="gift">
          <el-input v-model="form.gift" placeholder="请输入礼物" />
        </el-form-item>
        <el-form-item label="礼品信息" prop="giftMessage">
          <el-input v-model="form.giftMessage" placeholder="请输入礼品信息" />
        </el-form-item>
        <el-form-item label="出货数量" prop="quantityShipped">
          <el-input v-model="form.quantityShipped" placeholder="请输入出货数量" />
        </el-form-item>
        <el-form-item label="装运承运人" prop="shipmentCarrier">
          <el-input v-model="form.shipmentCarrier" placeholder="请输入装运承运人" />
        </el-form-item>
        <el-form-item label="装运方式" prop="shipmentMethod">
          <el-input v-model="form.shipmentMethod" placeholder="请输入装运方式" />
        </el-form-item>
        <el-form-item label="装运跟踪编号" prop="shipmentTrackingNumber">
          <el-input v-model="form.shipmentTrackingNumber" placeholder="请输入装运跟踪编号" />
        </el-form-item>
        <el-form-item label="装运日期" prop="shipDate">
          <el-input v-model="form.shipDate" placeholder="请输入装运日期" />
        </el-form-item>
        <el-form-item label="groupon sku" prop="grouponSku">
          <el-input v-model="form.grouponSku" placeholder="请输入groupon sku" />
        </el-form-item>
        <el-form-item label="自定义域值" prop="customFieldValue">
          <el-input v-model="form.customFieldValue" placeholder="请输入自定义域值" />
        </el-form-item>
        <el-form-item label="Permalink" prop="permalink">
          <el-input v-model="form.permalink" placeholder="请输入Permalink" />
        </el-form-item>
        <el-form-item label="项目名称" prop="itemName">
          <el-input v-model="form.itemName" placeholder="请输入项目名称" />
        </el-form-item>
        <el-form-item label="供应商id" prop="vendorId">
          <el-input v-model="form.vendorId" placeholder="请输入供应商id" />
        </el-form-item>
        <el-form-item label="salesforce交易选项id" prop="salesforceDealOptionId">
          <el-input v-model="form.salesforceDealOptionId" placeholder="请输入salesforce交易选项id" />
        </el-form-item>
        <el-form-item label="groupon成本" prop="grouponCost">
          <el-input v-model="form.grouponCost" placeholder="请输入groupon成本" />
        </el-form-item>
        <el-form-item label="帐单地址名称" prop="billingAddressName">
          <el-input v-model="form.billingAddressName" placeholder="请输入帐单地址名称" />
        </el-form-item>
        <el-form-item label="帐单地址街道" prop="billingAddressStreet">
          <el-input v-model="form.billingAddressStreet" placeholder="请输入帐单地址街道" />
        </el-form-item>
        <el-form-item label="开单地址城市" prop="billingAddressCity">
          <el-input v-model="form.billingAddressCity" placeholder="请输入开单地址城市" />
        </el-form-item>
        <el-form-item label="帐单地址统计" prop="billingAddressStat">
          <el-input v-model="form.billingAddressStat" placeholder="请输入帐单地址统计" />
        </el-form-item>
        <el-form-item label="帐单地址邮政编码" prop="billingAddressPostalCode">
          <el-input v-model="form.billingAddressPostalCode" placeholder="请输入帐单地址邮政编码" />
        </el-form-item>
        <el-form-item label="开单地址国家/地区" prop="billingAddressCountry">
          <el-input v-model="form.billingAddressCountry" placeholder="请输入开单地址国家/地区" />
        </el-form-item>
        <el-form-item label="采购订单编号" prop="purchaseOrderNumber">
          <el-input v-model="form.purchaseOrderNumber" placeholder="请输入采购订单编号" />
        </el-form-item>
        <el-form-item label="产品重量" prop="productWeight">
          <el-input v-model="form.productWeight" placeholder="请输入产品重量" />
        </el-form-item>
        <el-form-item label="产品重量单位" prop="productWeightUnit">
          <el-input v-model="form.productWeightUnit" placeholder="请输入产品重量单位" />
        </el-form-item>
        <el-form-item label="产品长度" prop="productLength">
          <el-input v-model="form.productLength" placeholder="请输入产品长度" />
        </el-form-item>
        <el-form-item label="产品宽度" prop="productWidth">
          <el-input v-model="form.productWidth" placeholder="请输入产品宽度" />
        </el-form-item>
        <el-form-item label="产品高度" prop="productHeight">
          <el-input v-model="form.productHeight" placeholder="请输入产品高度" />
        </el-form-item>
        <el-form-item label="产品尺寸单位" prop="productDimensionUnit">
          <el-input v-model="form.productDimensionUnit" placeholder="请输入产品尺寸单位" />
        </el-form-item>
        <el-form-item label="客户电话" prop="customerPhone">
          <el-input v-model="form.customerPhone" placeholder="请输入客户电话" />
        </el-form-item>
        <el-form-item label="国际贸易术语解释通则" prop="incoterms">
          <el-input v-model="form.incoterms" placeholder="请输入国际贸易术语解释通则" />
        </el-form-item>
        <el-form-item label="高温超导码" prop="htsCode">
          <el-input v-model="form.htsCode" placeholder="请输入高温超导码" />
        </el-form-item>
        <el-form-item label="第三方物流名称" prop="threePlName">
          <el-input v-model="form.threePlName" placeholder="请输入第三方物流名称" />
        </el-form-item>
        <el-form-item label="第三方物流仓库货位" prop="threePlWarehouseLocation">
          <el-input v-model="form.threePlWarehouseLocation" placeholder="请输入第三方物流仓库货位" />
        </el-form-item>
        <el-form-item label="套件细节" prop="kittingDetails">
          <el-input v-model="form.kittingDetails" placeholder="请输入套件细节" />
        </el-form-item>
        <el-form-item label="销售价格" prop="sellPrice">
          <el-input v-model="form.sellPrice" placeholder="请输入销售价格" />
        </el-form-item>
        <el-form-item label="交易机会id" prop="dealOpportunityId">
          <el-input v-model="form.dealOpportunityId" placeholder="请输入交易机会id" />
        </el-form-item>
        <el-form-item label="出货策略" prop="shipmentStrategy">
          <el-input v-model="form.shipmentStrategy" placeholder="请输入出货策略" />
        </el-form-item>
        <el-form-item label="履行方式" prop="fulfillmentMethod">
          <el-input v-model="form.fulfillmentMethod" placeholder="请输入履行方式" />
        </el-form-item>
        <el-form-item label="原产国" prop="countryOfOrigin">
          <el-input v-model="form.countryOfOrigin" placeholder="请输入原产国" />
        </el-form-item>
        <el-form-item label="商人permalink" prop="merchantPermalink">
          <el-input v-model="form.merchantPermalink" placeholder="请输入商人permalink" />
        </el-form-item>
        <el-form-item label="功能开始日期" prop="featureStartDate">
          <el-input v-model="form.featureStartDate" placeholder="请输入功能开始日期" />
        </el-form-item>
        <el-form-item label="功能结束日期" prop="featureEndDate">
          <el-input v-model="form.featureEndDate" placeholder="请输入功能结束日期" />
        </el-form-item>
        <el-form-item label="bom sku" prop="bomSku">
          <el-input v-model="form.bomSku" placeholder="请输入bom sku" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder } from "@/api/system/order";

export default {
  name: "Order",
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 采购单表格数据
      orderList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        fulfillmentLineItemId: null,
        grouponNumber: null,
        orderDate: null,
        merchantSkuItem: null,
        quantityRequested: null,
        shipmentMethodRequested: null,
        shipmentAddressName: null,
        shipmentAddressStreet: null,
        shipmentAddressCity: null,
        shipmentAddressStat: null,
        shipmentAddressPostalCode: null,
        shipmentAddressCountry: null,
        gift: null,
        giftMessage: null,
        quantityShipped: null,
        shipmentCarrier: null,
        shipmentMethod: null,
        shipmentTrackingNumber: null,
        shipDate: null,
        grouponSku: null,
        customFieldValue: null,
        permalink: null,
        itemName: null,
        vendorId: null,
        salesforceDealOptionId: null,
        grouponCost: null,
        billingAddressName: null,
        billingAddressStreet: null,
        billingAddressCity: null,
        billingAddressStat: null,
        billingAddressPostalCode: null,
        billingAddressCountry: null,
        purchaseOrderNumber: null,
        productWeight: null,
        productWeightUnit: null,
        productLength: null,
        productWidth: null,
        productHeight: null,
        productDimensionUnit: null,
        customerPhone: null,
        incoterms: null,
        htsCode: null,
        threePlName: null,
        threePlWarehouseLocation: null,
        kittingDetails: null,
        sellPrice: null,
        dealOpportunityId: null,
        shipmentStrategy: null,
        fulfillmentMethod: null,
        countryOfOrigin: null,
        merchantPermalink: null,
        featureStartDate: null,
        featureEndDate: null,
        bomSku: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询采购单列表 */
    getList() {
      this.loading = true;
      listOrder(this.queryParams).then(response => {
        this.orderList = response.rows;
        this.total = response.total;
        this.loading = false;
      });

      this.loading = true;
      listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
          this.userList = response.rows;
          this.total = response.total;
          this.loading = false;
        }
      );


    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        fulfillmentLineItemId: null,
        grouponNumber: null,
        orderDate: null,
        merchantSkuItem: null,
        quantityRequested: null,
        shipmentMethodRequested: null,
        shipmentAddressName: null,
        shipmentAddressStreet: null,
        shipmentAddressCity: null,
        shipmentAddressStat: null,
        shipmentAddressPostalCode: null,
        shipmentAddressCountry: null,
        gift: null,
        giftMessage: null,
        quantityShipped: null,
        shipmentCarrier: null,
        shipmentMethod: null,
        shipmentTrackingNumber: null,
        shipDate: null,
        grouponSku: null,
        customFieldValue: null,
        permalink: null,
        itemName: null,
        vendorId: null,
        salesforceDealOptionId: null,
        grouponCost: null,
        billingAddressName: null,
        billingAddressStreet: null,
        billingAddressCity: null,
        billingAddressStat: null,
        billingAddressPostalCode: null,
        billingAddressCountry: null,
        purchaseOrderNumber: null,
        productWeight: null,
        productWeightUnit: null,
        productLength: null,
        productWidth: null,
        productHeight: null,
        productDimensionUnit: null,
        customerPhone: null,
        incoterms: null,
        htsCode: null,
        threePlName: null,
        threePlWarehouseLocation: null,
        kittingDetails: null,
        sellPrice: null,
        dealOpportunityId: null,
        shipmentStrategy: null,
        fulfillmentMethod: null,
        countryOfOrigin: null,
        merchantPermalink: null,
        featureStartDate: null,
        featureEndDate: null,
        bomSku: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加采购单";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getOrder(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改采购单";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateOrder(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addOrder(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$confirm('是否确认删除采购单编号为"' + ids + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delOrder(ids);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有采购单数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportOrder(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    }
  }
};
</script>
